package ensemble.samples.controls

import ensemble.DynamicSizeSample
import javafx.scene.control.{Label, MenuBar, CheckMenuItem}
import javafx.geometry.Pos

class MenuSampleS extends DynamicSizeSample {

  import net.oschina.oldpig.snout.FxBuilder._

  def isMac = System.getProperty("os.name").startsWith("Mac")

/*
  val useSystemMenuBarCB = is[CheckMenuItem]
  val mainMenuBar = is[MenuBar]
  val sysMenuLabel = is[Label]
  val menu113 = is[CheckMenuItem]
*/

  def content = vBox(spacing := 20) {
/*
    menuBar(useSystemMenuBar <= useSystemMenuBarCB.selectedProperty) {
      menu(text := "Options") {
        menu(text := "Submenu 1", graphic := "menuInfo.png") {
          menuItem(text := "blah")
          menuItem(text := "foo", visible <= menu113.selectedProperty)
          checkMenuItem(text := """Show "foo" item""", selected := true) as menu113
        }
        menu(text := "Submenu 2") {
          menuItem(text := "Item 1")
          menuItem(text := "Item 2")
        }
        menuItem(text := "Change Text", accelerator := "Shortcut+C")
      }
      if (isMac) {
        menu(text := "MenuBar Options") {
          checkMenuItem(text := "Use System Menu Bar", selected := true)
        }
      }
    } as mainMenuBar
    if (isMac) {
      hBox(alignment := Pos.CENTER) {
        label(text := "Using System Menu", style := "-fx-font-size: 24",
          visible <= mainMenuBar.heightProperty =? 0) as sysMenuLabel
      }
    }
*/
  }

}
